import Vue from 'vue'
import store from '@/store'
import SvgIcon from '@/components/SvgIcon'// svg component

// register globally
Vue.component('svg-icon', SvgIcon)

const req = require.context('./svg', false, /\.svg$/)
store.dispatch('icon/addAllIcons', req.keys().map(key => key.replace(/.svg|.\//g, '')))
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
